package com.ssi.myshop.utils;

import com.ssi.myshop.Presenter.impl.IAddToCarPresenterImpl;
import com.ssi.myshop.Presenter.impl.IBannerPresenterImpl;
import com.ssi.myshop.Presenter.impl.ICategoryPresenterImpl;
import com.ssi.myshop.Presenter.impl.IDetailPresenterImpl;
import com.ssi.myshop.Presenter.impl.ILoginPresenterImpl;
import com.ssi.myshop.Presenter.impl.IRegisterPresentImpl;

public class PresenterManager {

    private final IRegisterPresentImpl mIRegisterPresent;
    private final ILoginPresenterImpl mLoginPresenter;
    private final IBannerPresenterImpl mIBannerPresenter;
    private final ICategoryPresenterImpl mICategoryPresenter;
    private final IDetailPresenterImpl mIDetailPresenter;
    private final IAddToCarPresenterImpl mIAddToCarPresenter;

    private PresenterManager() {
        mIRegisterPresent = new IRegisterPresentImpl();
        mLoginPresenter = new ILoginPresenterImpl();
        mIBannerPresenter = new IBannerPresenterImpl();
        mICategoryPresenter = new ICategoryPresenterImpl();
        mIDetailPresenter = new IDetailPresenterImpl();
        mIAddToCarPresenter = new IAddToCarPresenterImpl();
    }

    private static PresenterManager ourInstance = null;

    public static PresenterManager getInstance() {
        if (ourInstance == null) {
            synchronized (PresenterManager.class) {
                if (ourInstance == null) {
                    ourInstance = new PresenterManager();
                }
            }
        }
        return ourInstance;
    }

    public IRegisterPresentImpl getIRegisterPresent() {
        return mIRegisterPresent;
    }

    public ILoginPresenterImpl getLoginPresenter() {
        return mLoginPresenter;
    }

    public IBannerPresenterImpl getBannerPresenter() {
        return mIBannerPresenter;
    }

    public ICategoryPresenterImpl getCategoryPresenter(){
        return mICategoryPresenter;
    }

    public IDetailPresenterImpl getIDetailPresenter(){
        return mIDetailPresenter;
    }

    public IAddToCarPresenterImpl getIAddToCarPresenter(){
        return mIAddToCarPresenter;
    }
}
